package cn.marinda.resturants.utils;

import lombok.Data;

/**接口请求结果
 * description:
 * 代号：
 * 200 成功
 * 400 失败
 * 600 异常
 * 800 权限问题
 *
 *
 * @date 2021/11/16
 * @author Marinda
 */
@Data
public class ApiResult {

    public static final String ON_SUCCESS = "200";
    public static final String ON_FAIL = "400";
    public static final String ON_ERROR = "600";
    public static final String ON_PERMISSION = "800";

    public static final String SUCCESS_MESSAGE = "成功";
    public static final String ERROR_MESSAGE = "错误";
    public static final String FAIL_MESSAGE = "失败";
    public static final String PERMISSION_MESSAGE = "权限异常";
    //001成功 002失败
    private String status;
    private String msg;
    private Object data;
    private int count;
    private int code;

    public ApiResult(String status, String message, Object data) {
        this.status = status;
        this.msg = message;
        this.data = data;
    }

    public ApiResult(int code, String message, Object data, int count) {
        this.code = code;
        this.msg = message;
        this.data = data;
        this.count = count;
    }
}